local fujian = fk.CreateSkill {

  name = "joy__fujian",

  tags = { Skill.Compulsory, },

}



fujian:addEffect(fk.EventPhaseStart, {
  name = "joy__fujian",
  anim_type = "control",
  frequency = Skill.Compulsory,
  events = {fk.EventPhaseStart},
  can_trigger = function(self, event, target, player, data)
    return target == player and player:hasSkill(fujian.name) and player.phase == Player.Finish and
      not table.find(player.room.alive_players, function(p) return p:isKongcheng() end)
  end,
  on_use = function(self, event, target, player, data)
    local room = player.room
    local targets = room:getOtherPlayers(player, false)
    local to = table.random(targets)
    room:doIndicate(player.id, {to.id})
    U.viewCards(player, table.random(to.player_cards[Player.Hand], 1), fujian.name)
  end,
})

return fujian